// TemplateClassExample.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

template <class PARATYPE>
class NormalClass
{
protected:
	PARATYPE m_value;
public:
	PARATYPE getValue(){return m_value;};
	void setValue(PARATYPE val){m_value = val;};
	void addValue(int addvalue);
	
	NormalClass& operator + (NormalClass &tem);
	
};

template <class PARATYPE>
NormalClass<PARATYPE>& NormalClass<PARATYPE>::operator + (NormalClass<PARATYPE> &tem)
{
	m_value += tem.m_value;
	return *this;
}

template <class PARATYPE>
void NormalClass<PARATYPE>::addValue(int addvalue)
{	
	m_value += addvalue;
}

template <class PARATYPE1,class PARATYPE2>
class NormalClass2
{
protected:
	PARATYPE1 m_value1;
	PARATYPE2 m_value2;
public:
	PARATYPE1 getValue1(){return m_value1;};
	void setValue1(PARATYPE1 val1){m_value1 = val1;};

	PARATYPE2 getValue2(){return m_value2;};
	void setValue2(PARATYPE2 val2){m_value2 = val2;};

	void addTwoValue(int val1,int val2);
};

template <class PARATYPE1,class PARATYPE2>
void NormalClass2<PARATYPE1,PARATYPE2>::addTwoValue(int val1,int val2)
{
	m_value1 += val1;
	m_value2 += val2;
}


int main(int argc, char* argv[])
{
	NormalClass<int> a;
	a.setValue(5);

	NormalClass<float> b;
	b.setValue(10.2f);

	NormalClass<double> c;
	c.setValue(34.444);

	NormalClass2<int,double> d;
	d.setValue1(45);
	d.setValue2(5.6);
	
	NormalClass<int> e;
	e.setValue(15);
	
	a = a + e;


	return 0;
}

